import curses
import git
from compark import SuperMenu

class CloneRepoMenu(SuperMenu):

    global local_path
    global window

    def addInterface(self, _menu_window):
	global local_path
	global window
	_menu_window.addstr(1,0,"Local repo path   : ")
	local_path = _menu_window.getstr(1,25,60)
	self.setStartOptionOffset(4)
	self.addOption("See status")
	self.addBackOption()
	self.build()
	window = _menu_window

    def keyInput(self, key):
	if key == "1":
	    global local_path
	    global window
	    #git = sh.git.bake(_cwd=local_path)
	    repo = git.Repo(local_path)
	    status = repo.git.status()
	    #status = git.status()
	    #print status
	    window.addstr(2,2,status)
	    return 0
	else:
	    return 0
